#!/usr/bin/python
# coding:utf-8
import os

print("=================shell-awk=======================================")
os.system("awk -F: '{print \"username is:\"$1,\"uid is:\"$3}' /etc/passwd")
print("=======================================================")
print("=======================================================")
print("=======================python-os-popne================================")

f_pass = os.popen("cat /etc/passwd").readlines()
for i in f_pass:
    print("username is:",i.split(":")[0],"uid is:",i.split(":")[2])
print("========================================================")
print("===========================subprocess.geroutput=============================")
import subprocess

f_passwd = subprocess.getoutput("cat /etc/passwd")
f_lines = f_passwd.splitlines()
for n in f_lines:
    print("username is:",n.split(":")[0],"uid is:",n.split(":")[2])

print("=================python-open======================================")
open_pass = open("/etc/passwd")
for i in open_pass:
    print("username is:%s  uid is:%s" % (i.split(":")[0],i.split(":")[2]))
print("========================================================")
print("========================================================")
